Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional #189

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Functional #189

wants to merge 3 commits into from

Conversation

ljwolf
Copy link
Member

@ljwolf ljwolf commented Aug 12, 2021

This is a bit of metaprogramming that re-rexpresses most of the esda stats classes as functions that just return the statistic and a simulated p-value.

Still needs work with the LOSH and Spatial_Pearson statistics, but this is one of the two APIs I think we should adopt. The other is the LOSH/Spatial_Pearson-style sklearn estimator.

@ljwolf ljwolf added the WIP work in progress (for discussion) label Aug 12, 2021
@codecov-commenter
Copy link

codecov-commenter commented Aug 12, 2021

Codecov Report

Attention: Patch coverage is 49.42529% with 44 lines in your changes missing coverage. Please review.

Project coverage is 79.6%. Comparing base (4a63e0b) to head (aa1275a).
Report is 201 commits behind head on main.

Files with missing lines Patch % Lines
esda/functions.py 0.0% 34 Missing ⚠️
esda/losh.py 76.9% 3 Missing ⚠️
esda/lee.py 60.0% 2 Missing ⚠️
esda/geary_local.py 80.0% 1 Missing ⚠️
esda/geary_local_mv.py 93.3% 1 Missing ⚠️
esda/join_counts_local.py 80.0% 1 Missing ⚠️
esda/join_counts_local_bv.py 80.0% 1 Missing ⚠️
esda/join_counts_local_mv.py 80.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #189     +/-   ##
=======================================
- Coverage   80.6%   79.6%   -1.0%     
=======================================
  Files         42      45      +3     
  Lines       4277    4644    +367     
=======================================
+ Hits        3447    3695    +248     
- Misses       830     949    +119     
Files with missing lines Coverage Δ
esda/geary_local.py 86.7% <80.0%> (-1.1%) ⬇️
esda/geary_local_mv.py 98.5% <93.3%> (-1.5%) ⬇️
esda/join_counts_local.py 98.0% <80.0%> (-2.0%) ⬇️
esda/join_counts_local_bv.py 96.3% <80.0%> (-1.1%) ⬇️
esda/join_counts_local_mv.py 98.1% <80.0%> (-1.9%) ⬇️
esda/lee.py 21.9% <60.0%> (+1.4%) ⬆️
esda/losh.py 88.1% <76.9%> (-1.6%) ⬇️
esda/functions.py 0.0% <0.0%> (ø)

... and 3 files with indirect coverage changes

esda/crand_perf_nogit.py Outdated Show resolved Hide resolved
esda/crand_perf_sim.py Outdated Show resolved Hide resolved
klassname = klass.__name__
name = klass.__name__.lower()
if klassname == "LOSH":
defn = f"def {name}(*args, **kwargs):\n\tobj = {klassname}(*args, **kwargs)\n\treturn obj._statistic, obj.pval"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These have to separate the init and fit phases, so I need to figure out how to re-write the signature so that the options all go through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP work in progress (for discussion)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants